/*
    NAME: mspcmd.h

    PURPOSE:
        This file contains definitions for commands that can be set
        and queried by an application using the MSPP Service.

  Copyright (c) 2004  NMS Communications Corp.  All rights reserved.

*/

#ifndef MSPCMD_H
#define MSPCMD_H

#include "msptypes.h"
#include "mspdef.h"
#include "mspinit.h"


#ifdef __cplusplus
extern "C"
{
#endif

/* Macro used to concatenate commands with filter definitions */
#define  mspBuildCommand(filter,command)     (((filter) << 8) | (command))

/* Macro used to build the unique ID used with MSP_SEND_COMMAND_DONE and MSP_QUERY_DONE events */
#define  mspBuildUniqueId(filter,event)      (((filter) << 8) | ((event) & 0x000000FF))

/************************************************************************\
 *                              MSPP COMMANDS                           *
 *                                                                      *
\************************************************************************/

/*
    Each MSPP Object can have 248 commands.  Hence, the range of command code
    for each MSPP object (filter) is between 0x00 - 0xEF.  Command codes
    between 0xF0 - 0xFF are reserved for commands that can be applied to
    all MSPP objects, example: MSP_CMD_ESC.
*/

/* Commands applied to all filters */

/*******************************************************************/
/* Fusion DPF Commands/Events                                      */
/* Commands:                                                       */
/*   "SET" commands occupy 0x0000 to 0x000F                        */
/*   "GET" commands occupy 0x0010 to 0x001F                        */
/*   Diagnostic/Debug commands occupy 0x0020 to 0x002F             */
/*                                                                 */
/* All events will echo the Command Message Type, and attach the   */
/* appropriate data if required.  Unknown, or non-implemented      */
/* funtions will echo the command "OR-ed" with                     */
/* FUNCTION_NOT_IMPLEMENTED                                        */
/*******************************************************************/

/*******************************************************************/
/* Encoder commands                                                */
/*   See MSP Command Buffer area below for the format of buffer    */
/* field sent to a MSP Encoder object via the mspSendCommand API   */
/* function.                                                       */
/*******************************************************************/

#define MSP_CMD_ENCODE_MODE                         0X0000
#define MSP_CMD_ENCODE_GAIN                         0x0001
#define MSP_CMD_ENCODE_VAD                          0x0002
#define MSP_CMD_ENCODE_SUPPRESS_FILTERS             0x0003
#define MSP_CMD_ENCODE_IP_FORMAT                    0x0004
#define MSP_CMD_ENCODE_RATE                         0x0005
#define MSP_CMD_ENCODE_PAYLOAD_ID                   0x0006
#define MSP_CMD_ENCODE_ALL                          0x0007
#define MSP_CMD_ENCODE_DTMF_MODE                    0x0008
#define MSP_CMD_ENCODE_PLAY_RFC2833                 0x000A

/*******************************************************************/
/* Decoder commands                                                */
/*   See MSP Command Buffer area below for the format of buffer    */
/* field sent to a MSP Decoder object via the mspSendCommand API   */
/* function.                                                       */
/*******************************************************************/

#define MSP_CMD_DECODE_MODE                         0X0000
#define MSP_CMD_DECODE_GAIN                         0x0001
#define MSP_CMD_DECODE_IP_FORMAT                    0x0004
#define MSP_CMD_DECODE_PAYLOAD_ID                   0x0006
#define MSP_CMD_DECODE_ALL                          0x0007
#define MSP_CMD_DECODE_DTMF_MODE                    0x0008
#define MSP_CMD_DECODE_PLAY_DTMF_DIGIT              0x0009

/*******************************************************************/
/* T.38 Fax Modulator/Demodulator DPF filter commands              */
/*******************************************************************/
#define MSP_CMD_FAXRELAY_CONFIG                     0x000A
#define MSP_CMD_FAXRELAY_DIAGNOSTICS                0x000B

/*******************************************************************/
/* Escape Command                                                  */
/*******************************************************************/
#define MSP_CMD_ESC                                 0x00F0

/*******************************************************************/
/* Error Event Code                                                */
/*******************************************************************/
#define FUNCTION_NOT_IMPLEMENTED                    0x0900

/*******************************************************************/
/* DS0 Terminal filter commands                                    */
/*******************************************************************/
#define     MSP_CMD_DS0_CONFIG                      0x00

/*******************************************************************/
/* RTP Full duplex terminal filter commands                        */
/*******************************************************************/
#define     MSP_CMD_RTPFDX_CONFIG                   0x00
#define     MSP_CMD_RTPFDX_RTCP_EVENTS              0x01
#define     MSP_CMD_RTPFDX_CHG_QUOTA                0x02
#define     MSP_CMD_RTPFDX_MAP                      0x03
#define     MSP_CMD_RTPFDX_DTMF_EVENTS              0x04
#define     MSP_CMD_RTPFDX_LINK_EVENTS              0x05
#define     MSP_CMD_RTPFDX_V6_CONFIG                MSP_CMD_RTPFDX_CONFIG

#define     MSP_CMD_RTPFDX_SET_TS_SMOOTHING_THRESH  0x06

/* For Video Endpoints */
#define     MSP_CMD_RTPFDX_VIDEO_RTP_PKTSZ_CTRL     0x07
#define     MSP_CMD_RTPFDX_DISCARD_PENDING_PFRAMES  0x08
#define     MSP_CMD_RTPFDX_STOP_VIDEO_RX            0x09
#define     MSP_CMD_RTPFDX_RTTS_CTRL                0x13
#define     MSP_CMD_RTPFDX_IFRAME_NOTIFY_CTRL       0x14
#define     MSP_CMD_RTPFDX_OUT_OF_BAND_DCI          0x15
#define     MSP_CMD_RTPFDX_H263_ENCAP_CTRL          0x16
#define     MSP_CMD_RTPFDX_VIDEO_SKEW_TIME          0x17
#define     MSP_CMD_RTPFDX_CALC_SKEW_OFFSET         0x18
#define     MSP_CMD_RTPFDX_SET_VID_TX_PID           0x19
#define     MSP_CMD_RTPFDX_DISABLE_I_FRM_SEG        0x1A

/*******************************************************************/
/* RTP IN terminal filter commands                                 */
/*   Based off of RTP FDX Commands                                 */
/*******************************************************************/
#define     MSP_CMD_RTPIN_CONFIG               MSP_CMD_RTPFDX_CONFIG
#define     MSP_CMD_RTPIN_RTCP_EVENTS          MSP_CMD_RTPFDX_RTCP_EVENTS
#define     MSP_CMD_RTPIN_MAP                  MSP_CMD_RTPFDX_MAP
#define     MSP_CMD_RTPIN_DTMF_EVENTS          MSP_CMD_RTPFDX_DTMF_EVENTS
#define     MSP_CMD_RTPIN_V6_CONFIG            MSP_CMD_RTPFDX_V6_CONFIG
#define     MSP_CMD_RTPIN_DISCARD_PENDING_PFRAMES  MSP_CMD_RTPFDX_DISCARD_PENDING_PFRAMES
#define     MSP_CMD_RTPIN_STOP_VIDEO_RX            MSP_CMD_RTPFDX_STOP_VIDEO_RX
#define     MSP_CMD_RTPIN_IFRAME_NOTIFY_CTRL       MSP_CMD_RTPFDX_IFRAME_NOTIFY_CTRL
#define     MSP_CMD_RTPIN_H263_ENCAP_CTRL          MSP_CMD_RTPFDX_H263_ENCAP_CTRL
#define     MSP_CMD_RTPIN_CALC_SKEW_OFFSET         MSP_CMD_RTPFDX_CALC_SKEW_OFFSET


/*******************************************************************/
/* RTP OUT terminal filter commands                                */
/*   Based off of RTP FDX Commands                                 */
/*******************************************************************/
#define     MSP_CMD_RTPOUT_CONFIG              MSP_CMD_RTPFDX_CONFIG
#define     MSP_CMD_RTPOUT_RTCP_EVENTS         MSP_CMD_RTPFDX_RTCP_EVENTS
#define     MSP_CMD_RTPOUT_CHG_QUOTA           MSP_CMD_RTPFDX_CHG_QUOTA
#define     MSP_CMD_RTPOUT_LINK_EVENTS         MSP_CMD_RTPFDX_LINK_EVENTS
#define     MSP_CMD_RTPOUT_V6_CONFIG           MSP_CMD_RTPFDX_V6_CONFIG
#define     MSP_CMD_RTPOUT_VIDEO_RTP_PKTSZ_CTRL     MSP_CMD_RTPFDX_VIDEO_RTP_PKTSZ_CTRL
#define     MSP_CMD_RTPOUT_RTTS_CTRL                MSP_CMD_RTPFDX_RTTS_CTRL
#define     MSP_CMD_RTPOUT_IFRAME_NOTIFY_CTRL       MSP_CMD_RTPFDX_IFRAME_NOTIFY_CTRL
#define     MSP_CMD_RTPOUT_OUT_OF_BAND_DCI          MSP_CMD_RTPFDX_OUT_OF_BAND_DCI
#define     MSP_CMD_RTPOUT_H263_ENCAP_CTRL          MSP_CMD_RTPFDX_H263_ENCAP_CTRL
#define     MSP_CMD_RTPOUT_VIDEO_SKEW_TIME          MSP_CMD_RTPFDX_VIDEO_SKEW_TIME
#define     MSP_CMD_RTPOUT_SET_VID_TX_PID           MSP_CMD_RTPFDX_SET_VID_TX_PID
#define     MSP_CMD_RTPOUT_DISABLE_I_FRM_SEG        MSP_CMD_RTPFDX_DISABLE_I_FRM_SEG

/*******************************************************************/
/* UDP Full duplex terminal filter commands                        */
/*******************************************************************/
#define     MSP_CMD_UDPFDX_CONFIG                   0x00
#define     MSP_CMD_UDPFDX_V6_CONFIG                MSP_CMD_UDPFDX_CONFIG

/*******************************************************************/
/* UDP IN terminal filter commands                                 */
/*******************************************************************/
#define     MSP_CMD_UDPOUT_CONFIG                   0x00
#define     MSP_CMD_UDPOUT_V6_CONFIG                MSP_CMD_UDPOUT_CONFIG

/*******************************************************************/
/* UDP OUT terminal filter commands                                */
/*******************************************************************/
#define     MSP_CMD_UDPIN_CONFIG                    0x00
#define     MSP_CMD_UDPIN_V6_CONFIG                 MSP_CMD_UDPIN_CONFIG

/*******************************************************************/
/* Jitter filter commands                                          */
/*******************************************************************/
#define     MSP_CMD_JITTER_CHG_DEPTH                0x00
#define     MSP_CMD_JITTER_CHG_RFD                  0x01
#define     MSP_CMD_JITTER_INIT                     0x02
#define     MSP_CMD_JITTER_CHG_ADAPT                0x03
#define     MSP_CMD_JITTER_CHG_VIDEO_LATENCY        0x11
#define     MSP_CMD_JITTER_PURGE_VIDEO_LATENCY_BUF  0x12
#define     MSP_CMD_JITTER_NORMALIZE_VIDEO_LATENCY_BUF 0x13
/*******************************************************************/
/* RTP Assembly filter commands                                    */
/*******************************************************************/
#define     MSP_CMD_RTPASM_CHG_QUOTA                0x00
#define     MSP_CMD_RTPASM_INIT                     0x01

/*******************************************************************/
/* RTP Disassembly filter commands                                 */
/*******************************************************************/
#define     MSP_CMD_RTPDISASM_MAP                   0x00
#define     MSP_CMD_RTPDISASM_DTMF_NOTIFY           0x01
#define     MSP_CMD_RTPDISASM_INIT                  0x02

/*******************************************************************/
/* T.38 UDP Endpoint command                                       */
/*******************************************************************/
#define     MSP_CMD_T38UDP_CONFIG                   0x00
#define     MSP_CMD_T38IFPDEC_CONFIG                0x10
#define     MSP_CMD_T38IFPENC_CONFIG                0x20
#define     MSP_CMD_T38UDPTLDEC_CONFIG              0x30
#define     MSP_CMD_T38UDPTLENC_CONFIG              0x40

/*******************************************************************/
/* ThroughPacket commands                                          */
/*******************************************************************/
#define         MSP_CMD_TPKT_CONFIG                 0x01

/*******************************************************************/
/* MUX Endpoint commands - Media Gateway		                   */
/*******************************************************************/
#define     MSP_CMD_MUX_CONFIG                      0x00
#define		MSP_CMD_MUX_SEND_MC_INFO				0x01
#define		MSP_CMD_MUX_SEND_LCN_INFO				0x02
#define		MSP_CMD_MUX_SEND_CAPABILITY_SETTING		0x03
#define		MSP_CMD_MUX_SEND_H245_MSG				0x04
#define		MSP_CMD_MUX_SET_SN_MODE					0x05
#define		MSP_CMD_MUX_SET_AL_MODE					0x06
#define		MSP_CMD_MUX_START_DATA_DUMP				0x07
#define		MSP_CMD_MUX_STOP_DATA_DUMP				0x08
#define		MSP_CMD_MUX_DEMUX_OUT_QUEUE_CTRL		0x09
#define		MSP_CMD_MUX_SET_MC_TABLE_ENTRY   		0x0A
#define		MSP_CMD_MUX_GET_MC_TABLE_ENTRY		    0x0B
#define 	MSP_CMD_MUX_RESET_PMSYNC				0x0C
#define     MSP_CMD_MUX_RESET_VIDEO_SN              0x0D
#define		MSP_CMD_MUX_SET_NSRP_MODE				0x0E
#define		MSP_CMD_DEMUX_SET_NSRP_MODE				0x0F

#define		MSP_CMD_MUX_GET_NSRP_MODE				0x14
#define		MSP_CMD_DEMUX_GET_NSRP_MODE				0x15
#define		MSP_CMD_MUX_SET_STUFFING_MODE			0x16

#define		MSP_CMD_DEMUX_RESET_STATS				0x17
#define		MSP_CMD_DEMUX_GET_PERIODIC_STATS		0x18
#define		MSP_CMD_DEMUX_CRC_ERROR_REPORTS	        0x19
/* ****!!!!  (Strip the following from customer release) */
    /* The following are reserved for demux's RFC2833 support: */
    /*  MSP_CMD_DEMUX_PLAY_RFC2833                  0x1A */
    /*  MSP_CMD_DEMUX_DTMF_MODE                     0x1B */
    /* Only MW may use or demux cmd processing will intermittently hang */
/* ****!!!!  (end stripping) */

/*******************************************************************/
/* AMR Channel commands - Media Gateway		                       */
/*******************************************************************/
#define		MSP_CMD_AMR_SET_AUDIO_RATE				MSP_CMD_ENCODE_RATE //0x00
#define		MSP_CMD_AMR_SET_DTX						MSP_CMD_ENCODE_VAD  //0x01
#define		MSP_CMD_AMR_SET_PLC_MODE				0x02

/*******************************************************************/
/* Special Header commands - Media Gateway	    	               */
/*******************************************************************/
#define		MSP_CMD_VIDMP4_ADD_SPECIAL_HDR			0x21
#define		MSP_CMD_VIDMP4_REMOVE_SPECIAL_HDR		0x22

/************************************************************************\
 *                      MSP COMMAND BUFFERS                             *
 *                                                                      *
\************************************************************************/
/* These values define the format of data sent down to a MSP object in
   the buffer field of the mspSendCommand API call (if applicable).
   Naming format for this is: msp_[type]_[objectname]_[description]
   examples: type        = ENDPOINT, FILTER
             objectname  = JITTER, G723ENCODE, RTPASSEMBLER
             description = SETECHOTAPS,GAINVALUE

  pretend example:
  #define MSP_FILTER_G723_ENCODER   0x430000
  #define MSP_CMD_ENCODE_GAIN  0x01
  #define   mspBuildCommand(x,y) ((x<<8) | y)

  int x = 0x0200;
  ret = mspSendCommand ( MSPHD hMsp, mspBuildCommand
             (MSP_FILTER_G723_ENCODER, MSP_CMD_ENCODE_GAIN, &x, 2)

*/

/*******************************************************************/
/* DS0 endpoint command structure                                  */
/*******************************************************************/

typedef struct tag_msp_ENDPOINT_DS0_CONFIG
{
   MSP_MEDIA media; /* Specify either voice or fax. Used during voice
                        to fax switchover */

} msp_ENDPOINT_DS0_CONFIG;


/*******************************************************************/
/* RTP full duplex (RTPFDX) endpoint command structure             */
/*******************************************************************/

// generic RTPFDX command structure
typedef struct tag_msp_ENDPOINT_RTPFDX_CMD {
    DWORD   value;
} msp_ENDPOINT_RTPFDX_CMD;

// Disasm Vocoder Payload ID map
typedef struct tag_msp_ENDPOINT_RTPFDX_MAP {
    DWORD   vocoder;
    DWORD   payload_id;
} msp_ENDPOINT_RTPFDX_MAP;

// DTMF Event control settings
#define SEND_NO_EVENTS      0x0
#define SEND_FIRST_EVENT    0x1
#define SEND_LAST_EVENT     0x2
#define SEND_ALL_EVENTS     0x4

// Disasm DTMF Event control command
typedef struct DTMF_EVENT_CONTROL
{
  DWORD events:16;       // set according to above defines
  DWORD decimation:16;   // skips events when SEND_ALL_EVENTS
}DTMF_EVENT_CONTROL;

typedef struct tag_msp_FILTER_RTPFDX_DTMF_EVENT_CTRL {
    DTMF_EVENT_CONTROL  Control;
} msp_ENDPOINT_RTPFDX_DTMF_EVENT_CTRL;

// Config command sets ALL params
typedef struct {
   BYTE    localIPAddr[4];
   BYTE    remoteIPAddr[4];
   WORD    localUDPPort;
   WORD    remoteUDPPort;
   DWORD   rtpTsFreq;              /* RTP timestamp frequency */
   DWORD   typeOfService;      /* IP type of service */
   DWORD   startRtcp;          /* Anything but 0 means start RTCP */
   RTCP_SESSION_PARMS rtcpParms;   /* RTCP start params. Refer to mspdef.h
                      for RTCP_SESSION_PARAM structure */

   DTMF_EVENT_CONTROL  dtmfEventControl;
   DWORD               frameQuota;
   DWORD               linkEvents;

   msp_ENDPOINT_RTPFDX_MAP  PayloadMap;

 } msp_ENDPOINT_RTPFDX_CONFIG;

typedef struct {
   IPV6Addr  localIPv6Addr;
   IPV6Addr  remoteIPv6Addr;
   WORD      localUDPPort;
   WORD      remoteUDPPort;
   DWORD     rtpTsFreq;        /* RTP timestamp frequency */

   DWORD     trafficClass;     /* Indicates the class or priority of the IPv6 packet */
   DWORD     flowLabel;        /* Indicates the specific sequence the IPv6 packet belongs to */
   DWORD     linkNum;

   DWORD     startRtcp;        /* Anything but 0 means start RTCP */
   RTCP_SESSION_PARMS rtcpParms;   /* RTCP start params. Refer to mspdef.h
                      for RTCP_SESSION_PARAM structure */

   DTMF_EVENT_CONTROL  dtmfEventControl;
   DWORD               frameQuota;
   DWORD               linkEvents;

   msp_ENDPOINT_RTPFDX_MAP  PayloadMap;

 } msp_ENDPOINT_RTPFDX_V6_CONFIG;

#define MSPP_SET_RTCP_TOS(rtcpTos) (((DWORD)(rtcpTos)) << 16)

//Macros for setting RTCP information for Multimedia applications
#define  RTCP_ENABLE(x)                (x)=1                         //Sets value to 1
#define  RTCP_SET_0_INTERVAL(x)        ((x) | 2)                     //Sets 2nd bit
#define  RTCP_VIDEO_LEADS_AUDIO(x)     ((x) | 4)                     //Sets 3rd bit
#define  RTCP_ENABLE_RCV_SKEW_CALC(x)  ((x) | 8)                     //Sets 4th bit
#define  RTCP_VIDEO_SKEW(x,y)          ((x) | (((y) & 0x0fff) << 4)) //Sets 5th to 16th bits to value of y (max of 4095)
#define  RTCP_TOS(x,y)                 ((x) | ((((y) & 0xff) << 16)))//Sets tos byte in 16th bits

// enables/disables RTCP events
typedef struct {
   DWORD   events;         /* non-zero means send up indications
                      when badly formed RTCP reports received */
 } msp_ENDPOINT_RTPFDX_RTCP_EVENTS;

// enables/disables Link Status events
typedef struct {
   DWORD   events;         /* non-zero means send up indications
                      link erros are detected. */
 } msp_ENDPOINT_RTPFDX_LINK_EVENTS;

// sets Assem frame quota
#define MSP_CONST_RTP_FRAME_QUOTA_MAX      12
#define msp_ENDPOINT_RTPFDX_CHG_QUOTA msp_ENDPOINT_RTPFDX_CMD  // value is Assembler frame quota


//Addition for Timestamp Smoothing Command for custom endpoints
//on video-mail server
#define msp_ENDPOINT_RTPFDX_SET_TS_THRESH msp_ENDPOINT_RTPFDX_CMD  // value is threshold value
                                                                   // for timestamp smoothing

// Control RTP max pkt size, aggregation threshold, and aggregation enable flag
typedef struct tag_msp_ENDPOINT_RTPFDX_RTP_PKTSZ_CTRL {
    DWORD       pktMaxSz;                    // RTP pkt maximum transmit size
    DWORD       aggThreshold;                // RTP pkt aggregation threshold for video frames
    DWORD       enableAggregation;           // NZ if aggregation should be enabled
} msp_ENDPOINT_RTPFDX_RTP_PKTSZ_CTRL;

typedef struct {
   U32         enable;                       // NZ=enable, Z=disable
} msp_ENDPOINT_RTPFDX_RTTS_CTRL;

// Control sending of MSPEVN_VIDEO_IFRAME_H324 and MSPEVN_VIDEO_IFRAME_RTPIP msgs
// from RTP EPs.  For each direction, 0=disable; 1=next I-Frame; 2=each I-Frame.
typedef struct {
   U32         h324Notify;                  // Freq. to send msg when I-Frame arrives on H.324M
   U32         ipNotify;                    // Freq. to send msg when I-Frame arrives on RTP/IP
} msp_ENDPOINT_RTPFDX_IFRAME_NOTIFY_CTRL;

// RFC 2429 is the default H.263 video endpoint encapsulation type.
// An H.263 video endpoint can be set to RFC 2190 or 2429 encap using this cmd.
typedef struct {
   #define     MSP_H263_RFC2190   0         /* Encapsulate H.263 using RFC 2190 payload headers */
   #define     MSP_H263_RFC2429   1         /* Encapsulate H.263+ using RFC 2429 payload header */
   U32         h263Encap;                   // MSP_H263_RFC2190 or MSP_H263_RFC2429
} msp_ENDPOINT_RTPFDX_H263_ENCAP_CTRL;

#define MAX_DCI_BUF_SIZE  255
typedef struct {
   DWORD len;//Length of dci
   U8 mode;//0 : No out of band dci
                                //1:Use out-of-band DCI to replace only the initial DCI at the beginning of the bitstream
                                //2:Replace all in-band DCI with the out-of-band one
                                //3:Same as Option 2 but insert out-of-band DCI before every I-Frame if
                                //not already replacing an in-band DCI before each I-Frame.
   U8 data[MAX_DCI_BUF_SIZE];//buffer for saving the out_of_band_dci data.Currently it is static
} msp_ENDPOINT_RTPFDX_OUT_OF_BAND_DCI;

// To set a video skew time (relative to audio) to be used in RTCP SR's timestamp calculation for video streams
typedef struct {
   U32  vidSkew;         //Set value to 0-4095ms in 5th-16th bits (use RTCP_VIDEO_SKEW macro above)
                         //If value represents a video LEAD time as opposed to a LAG time,
                         //set 3rd bit with RTCP_VIDEO_LEADS_AUDIO macro above.
} msp_ENDPOINT_RTPFDX_SET_VID_SKEW;

// To enable calcuation of input skew offsets for aud/vid streams to be synchronized
typedef struct {
   U32  enable;         //Set 4th bit  to:  0 = disable;  1 = enable  (use RTCP_ENABLE_RCV_SKEW_CALC macro above)
} msp_ENDPOINT_RTPFDX_ENABLE_SKEW_CALC;

// To set the video transmit payload ID
typedef struct {
   U32  txPayloadId;         //Transmit Payload ID, max = 127
} msp_ENDPOINT_RTPFDX_SET_VID_TX_PID;




/*******************************************************************/
/* RTP IN endpoint command structure                               */
/*   Based off of RTP FDX Command structures                       */
/*******************************************************************/
#define msp_ENDPOINT_RTPIN_CMD             msp_ENDPOINT_RTPFDX_CMD
#define msp_ENDPOINT_RTPIN_CONFIG          msp_ENDPOINT_RTPFDX_CONFIG
#define msp_ENDPOINT_RTPIN_RTCP_EVENTS     msp_ENDPOINT_RTPFDX_RTCP_EVENTS
#define msp_ENDPOINT_RTPIN_MAP             msp_ENDPOINT_RTPFDX_MAP
#define msp_ENDPOINT_RTPIN_DTMF_EVENT_CTRL msp_ENDPOINT_RTPFDX_DTMF_EVENT_CTRL

/*******************************************************************/
/* RTP OUT endpoint command structure                              */
/*   Based off of RTP FDX Command structures                       */
/*******************************************************************/
#define msp_ENDPOINT_RTPOUT_CMD            msp_ENDPOINT_RTPFDX_CMD
#define msp_ENDPOINT_RTPOUT_CONFIG         msp_ENDPOINT_RTPFDX_CONFIG
#define msp_ENDPOINT_RTPOUT_RTCP_EVENTS    msp_ENDPOINT_RTPFDX_RTCP_EVENTS
#define msp_ENDPOINT_RTPOUT_LINK_EVENTS    msp_ENDPOINT_RTPFDX_LINK_EVENTS
#define msp_ENDPOINT_RTPOUT_CHG_QUOTA      msp_ENDPOINT_RTPFDX_CHG_QUOTA

/*******************************************************************/
/* T.38 UDP endpoint command structure                             */
/*******************************************************************/
typedef struct {
    BYTE   localIPAddr[4];
    WORD   localUDPPort;
    BYTE   remoteIPAddr[4];
    WORD   remoteUDPPort;
    DWORD  typeOfService;       /* IP type of service */

    // T.38 UDPTL decoder parameters
    msp_T38UDPTLDEC_CONFIG  UdptlDecodeParms;

    // T.38 UDPTL encoder parameters
    msp_T38UDPTLENC_CONFIG UdptlEncodeParms;

    // T.38 IFP decoder parameters
    msp_T38IFPDEC_CONFIG IfpDecodeParms;

    // T.38 IFP encoder parameters
    msp_T38IFPENC_CONFIG IfpEncodeParms;

} msp_ENDPOINT_T38UDP_CONFIG;


/*******************************************************************/
/* UDP full duplex (UDPFDX) endpoint command structure             */
/*******************************************************************/

typedef struct {

   BYTE   localIPAddr[4];
   WORD   localUDPPort;
   BYTE   remoteIPAddr[4];
   WORD   remoteUDPPort;
   DWORD  typeOfService;        /* IP type of service */

} msp_ENDPOINT_UDPFDX_CONFIG;


typedef struct {

   IPV6Addr  localIPv6Addr;
   WORD      localUDPPort;
   IPV6Addr  remoteIPv6Addr;
   WORD      remoteUDPPort;
   BYTE      trafficClass;     /* Indicates the class or priority of the IPv6 packet */
   DWORD     flowLabel;        /* Indicates the specific sequence the IPv6 packet belongs to */

} msp_ENDPOINT_UDPFDX_V6_CONFIG;


/*******************************************************************/
/* UDP IN endpoint command structure                               */
/*******************************************************************/

typedef struct {

   BYTE    localIPAddr[4];
   DWORD   localUDPPort;

} msp_ENDPOINT_UDPIN_CONFIG;

typedef struct {

   IPV6Addr  localIPv6Addr;
   DWORD     localUDPPort;

} msp_ENDPOINT_UDPIN_V6_CONFIG;

/*******************************************************************/
/* UDP OUT endpoint command structure                              */
/*******************************************************************/

typedef struct {

   BYTE   localIPAddr[4];
   WORD   localUDPPort;
   BYTE   remoteIPAddr[4];
   WORD   remoteUDPPort;
   DWORD  typeOfService;        /* IP type of service */

} msp_ENDPOINT_UDPOUT_CONFIG;

typedef struct {
   IPV6Addr  localIPv6Addr;
   WORD      localUDPPort;
   IPV6Addr  remoteIPv6Addr;
   WORD      remoteUDPPort;
   BYTE      trafficClass;     /* Indicates the class or priority of the IPv6 packet */
   DWORD     flowLabel;        /* Indicates the specific sequence the IPv6 packet belongs to */

} msp_ENDPOINT_UDPOUT_V6_CONFIG;


/*******************************************************************/
/* Encoder and Decoder buffer data structures                      */
/*******************************************************************/
typedef struct tag_msp_FILTER_ENCODE_CMD {
    WORD    value;
} msp_FILTER_ENCODE_CMD;

typedef struct tag_msp_FILTER_DECODE_CMD {
    WORD    value;
} msp_FILTER_DECODE_CMD;


// Set Encode DTMF Mode defines
#define DTMF_DISABLED         0x00
#define DTMF_INBAND_ENABLED   0x01
#define DTMF_EVENTS_ENABLED   0x02
#define VOICE_ENABLED         0x04
#define DTMF_SHIFT_ENABLED    0x08

// Encoder/Decoder IP Format Defines
#define G711_MULAW            0
#define G711_ALAW             1

#define AMR_IF2            	  0
#define AMR_RFC3267           1

#define G726_LITTLE_ENDIAN    0	 // RFC 2422
#define G726_BIG_ENDIAN       1	 // Cisco/Sonus Compatible



// Set Encode DTMF Mode data structure
typedef struct tag_msp_FILTER_ENCODE_DTMF_MODE_CMD {
   U8 Control;
   U8 PayloadID;
} msp_FILTER_ENCODE_DTMF_MODE_CMD;


// Set ALL Encode data structure
typedef struct tag_msp_FILTER_ENCODE_ALL_CMD {
   WORD Mode;
   WORD Gain;
   WORD VadControl;
   WORD NotchControl;
   WORD IPFormat;
   WORD Rate;
   WORD PayloadID;
   WORD DtmfMode;
} msp_FILTER_ENCODE_ALL_CMD;


// Play RFC 2833 Encode data structure
typedef struct tag_msp_FILTER_ENCODE_PLAY_RFC2833_CMD {
   WORD Event;
   WORD Duration;
} msp_FILTER_ENCODE_PLAY_RFC2833_CMD;

// Set ALL Decode data structure
typedef struct tag_msp_FILTER_DECODE_ALL_CMD {
   WORD Mode;
   WORD Gain;
   WORD IPFormat;
   WORD PayloadID;
   WORD DtmfMode;
} msp_FILTER_DECODE_ALL_CMD;


// Set Decode DTMF Mode defines
//#define DTMF_DISABLED         0x00  // see Encode define
//#define DTMF_INBAND_ENABLED   0x01  // see Encode define
#define DTMF_PLAY_ENABLED     0x02


// Set Decode DTMF Mode data structure
typedef struct tag_msp_FILTER_DECODE_DTMF_MODE_CMD {
   U8 Control;
   U8 PlayoutVal;
} msp_FILTER_DECODE_DTMF_MODE_CMD;


typedef struct tag_msp_FILTER_DECODE_PLAY_DTMF_DIGIT_CMD {
   WORD Digit;
   WORD Duration;
} msp_FILTER_DECODE_PLAY_DTMF_DIGIT_CMD;



// When using set ALL commands, any parameters in structures that are NOT
// intended to be changed must be set to PARM_NOT_SET.  If field is set to
// PARM_NOT_SET, default (or current) parameter setting will be maintained.
#define PARM_NOT_SET (-1)

typedef struct tag_msp_FILTER_FAXRELAY_DIAGNOSTICS {
    WORD    diagmask;
            #define FAXRELAY_DIAGMASK_DEFAULT                  0x0000
              #define FAXRELAY_DIAGMASK_GENERATE_MODEM_EVENTS  0x0001
              #define FAXRELAY_DIAGMASK_GENERATE_T30_EVENTS    0x0002
              #define FAXRELAY_DIAGMASK_RESERVED               0XFFFC
} msp_FILTER_FAXRELAY_DIAGNOSTICS;


/*******************************************************************/
/* Jitter filter buffer data structures                            */
/*******************************************************************/

// The maximum possible jitter depth has been increased from 16 to 100 in 
// Natural Access 2005 and later.  
// MSP_CONST_JITTER_DEPTH_MAX is the recommended value for DCE transport and
// is a practical limit for gateways, where mimimum delay is important.
// 
#define MSP_CONST_JITTER_DEPTH_MAX    16
#define MSP_JITTER_DEPTH_BOARD_LIMIT 100

#define MSP_CONST_JITTER_RFD_MAX     180   // Max value of Remove Frame Duration

#define MSP_G711_RFD   10
#define MSP_G723_RFD   30
#define MSP_G726_RFD   10
#define MSP_G728_RFD   10
#define MSP_G729_RFD   10
#define MSP_GSM_RFD    20
#define MSP_AMR_RFD    20
#define MSP_EVRC_RFD   20
#define MSP_ILBC20_RFD 20
#define MSP_ILBC30_RFD 30
#define MSP_GSMFR_RFD  20

#define MAX_JITTER_VIDEO_LATENCY  2000
typedef struct tag_msp_FILTER_JITTER_CMD {
    DWORD   value;
} msp_FILTER_JITTER_CMD;

typedef struct tag_msp_JITTER_VID_LATENCY {
    DWORD   value;
} msp_FILTER_JITTER_VID_LATENCY;

typedef struct tag_msp_FILTER_JITTER_CMD_INIT {
    DWORD   depth;
    DWORD   adapt_enabled;
    DWORD   rfd;
} msp_FILTER_JITTER_CMD_INIT;



/* Vocoder identifiers, internal to NMS */
#define MSP_CONST_VOCODER_PCMU       0
#define MSP_CONST_VOCODER_G726_32    2
#define MSP_CONST_VOCODER_GSM_FR     3  // for GSM_FR
#define MSP_CONST_VOCODER_G723       4
#define MSP_CONST_VOCODER_G728       15
#define MSP_CONST_VOCODER_PCMA       8
#define MSP_CONST_VOCODER_G729A      18
#define MSP_CONST_VOCODER_DTMF       96 // not actual vocoder
#define MSP_CONST_VOCODER_AMR        97 // for AMR IF2 IP Format
#define MSP_CONST_VOCODER_AMR3267    98 // for AMR RFC3267 IP Format
#define MSP_CONST_VOCODER_EVRC       99 // for EVRC Header Free Format
#define MSP_CONST_VOCODER_EVRC_BUND  100 // for EVRC Bundled Format
#define MSP_CONST_VOCODER_ILBC_20    101 // for ILBC_20
#define MSP_CONST_VOCODER_ILBC_30    102 // for ILBC_30                                         

/* RTP Disassembly filter: dynamic payload ID range */
#define MSP_CONST_AVP_DYNAMIC_LOW_LIM       96
#define MSP_CONST_AVP_DYNAMIC_UPR_LIM       127

// Video "Vocoders" (Media Gateway)
#define MSP_CONST_VOCODER_H263_2190_VIDEO	34
#define MSP_CONST_VOCODER_MPEG4_VIDEO		100
#define MSP_CONST_VOCODER_H263_2429_VIDEO	101
#define MSP_CONST_VOCODER_H264_VIDEO		104

/* KK - Added for Null Disassembly */
#define MSP_CONST_VOCODER_DISASSY_NULL       254 // not actual vocoder

/* RTP Disassembly filter: Special payload ID to disable a vocoder */
#define MSP_CONST_VOCODER_DISABLE           255

/*******************************************************************/
/* MUX endpoint command structures                                 */
/*******************************************************************/

typedef struct tag_msp_ENDPOINT_MUX_CONFIG
{
   MSP_MUX_MEDIA media; /* Specify either voice or fax. Always use voice.*/    
} msp_ENDPOINT_MUX_CONFIG;

typedef struct tag_msp_ENDPOINT_MUX_CONFIG_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
//	WORD	SuccessFlag;
   MSP_MUX_MEDIA media; /* Specify either voice or fax. Always use voice.*/    
} msp_ENDPOINT_MUX_CONFIG_ECHO;

typedef struct tag_msp_ENDPOINT_MUX_SEND_MC_INFO_CMD
{
	WORD	EntryNo;		// table entry number
} msp_ENDPOINT_MUX_SEND_MC_INFO_CMD;

typedef struct tag_msp_ENDPOINT_MUX_SEND_MC_INFO_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
//	WORD	SuccessFlag;
	WORD	EntryNo;		// table entry number
} msp_ENDPOINT_MUX_SEND_MC_INFO_CMD_ECHO;

#define	MAX_DATA_SIZE	256
typedef struct tag_msp_ENDPOINT_MUX_SEND_LCN_INFO_CMD
{
	WORD	LogChanNo;		// Logical Channer Number
	WORD	VideoALMode;	// AL mode (AL2/AL3) for Video
	WORD	DataKind;		// Audio/Video/Control 
	WORD	SNMode;			// Audio/Video sequence number parameter
                        // For Audio (0=off or 1=1 octet)
                        // For Video (0, 1, or 2=2 octet)
                        // Audio: 0 or 1 octet Sequence Number
                        // Video: 0 or 1 or 2 octet Control Field where the
                        // Control Field contains Sequence Number bits per AL3 spec
	WORD  CRC_Control;	// obsoleted field 
	WORD	MaxSDUSize;		// H.245 Max SDU size
	WORD 	NoOfFrames;		// # of frames (1,2,3) per Audio SDU (Audio Only)
	WORD	Reserved1;
	WORD	Reserved2;
	WORD	Reserved3;
	WORD	Reserved4;
	WORD	Reserved5;
	WORD	Reserved6;
} msp_ENDPOINT_MUX_SEND_LCN_INFO_CMD;

typedef struct tag_msp_ENDPOINT_MUX_SEND_LCN_INFO_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
	WORD	LogChanNo;		// Logical Channer Number
	WORD	VideoALMode;	// AL mode (AL2/AL3) for Video
	WORD	DataKind;		// Audio/Video/Control
	WORD	SNMode;			// Audio/Video sequence number parameter                    
                        // For Audio (0=off or 1=1 octet)                           
                        // For Video (0, 1, or 2=2 octet)                           
                        // Audio: 0 or 1 octet Sequence Number                      
                        // Video: 0 or 1 or 2 octet Control Field where the         
                        // Control Field contains Sequence Number bits per AL3 spec 
	WORD  CRC_Control;	// obsoleted field
	WORD	MaxSDUSize;		// H.245 Max SDU size
	WORD 	NoOfFrames;		// # of frames (1,2,3) per Audio SDU (Audio Only)
	WORD	Reserved1;
	WORD	Reserved2;
	WORD	Reserved3;
	WORD	Reserved4;
	WORD	Reserved5;
	WORD	Reserved6;
} msp_ENDPOINT_MUX_SEND_LCN_INFO_CMD_ECHO;

typedef struct tag_msp_ENDPOINT_MUX_SEND_CAPABILITY_SETTING_CMD
{
	WORD	AnnexFlag;		// MUX annex flag
	WORD	Mode;
} msp_ENDPOINT_MUX_SEND_CAPABILITY_SETTING_CMD;

typedef struct tag_msp_ENDPOINT_MUX_SEND_CAPABILITY_SETTING_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
//	WORD	SuccessFlag;
	WORD	AnnexFlag;		// MUX annex flag
	WORD	Mode;
} msp_ENDPOINT_MUX_SEND_CAPABILITY_SETTING_CMD_ECHO;

#define	MAX_H245_MSG_SIZE	300
typedef struct tag_msp_ENDPOINT_MUX_SEND_H245_MSG
{
	WORD	size;			// Size of H.245 message to be sent
	WORD	SeqNo;			// Sequence Number
	char	Data[MAX_H245_MSG_SIZE]; // H.245 data buffer
} msp_ENDPOINT_MUX_SEND_H245_MSG;

typedef struct tag_msp_ENDPOINT_MUX_SEND_H245_MSG_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
//	WORD	SuccessFlag;
	WORD	size;			// Size of H.245 message to be sent
	WORD	SeqNo;			// Sequence Number
	char	Data[MAX_H245_MSG_SIZE]; // H.245 data buffer
} msp_ENDPOINT_MUX_SEND_H245_MSG_ECHO;

// For debug purposes
typedef struct tag_msp_ENDPOINT_MUX_SET_SN_MODE_CMD
{
	WORD	SNMode;			// Sequence # On/Off for Audio
} msp_ENDPOINT_MUX_SET_SN_MODE_CMD;

typedef struct tag_msp_ENDPOINT_MUX_SET_SN_MODE_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
//	WORD	SuccessFlag;
	WORD	SNMode;			// Sequence # On/Off for Audio
} msp_ENDPOINT_MUX_SET_SN_MODE_CMD_ECHO;

// For debug purposes
typedef struct tag_msp_ENDPOINT_MUX_SET_AL_MODE_CMD
{
	WORD	VideoALMode;	// equivalent to ALClassification in LCN_INFO
} msp_ENDPOINT_MUX_SET_AL_MODE_CMD;

typedef struct tag_msp_ENDPOINT_MUX_SET_AL_MODE_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
//	WORD	SuccessFlag;
	WORD	VideoALMode;	// equivalent to ALClassification in LCN_INFO
} msp_ENDPOINT_MUX_SET_AL_MODE_CMD_ECHO;

// For debug purposes
typedef struct tag_msp_ENDPOINT_MUX_START_DATA_DUMP_CMD
{
	WORD	DataKind;	// Control/Video/Audio
} msp_ENDPOINT_MUX_START_DATA_DUMP_CMD;

typedef struct tag_msp_ENDPOINT_MUX_START_DATA_DUMP_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
//	WORD	SuccessFlag;
	WORD	DataKind;	// Control/Video/Audio
} msp_ENDPOINT_MUX_START_DATA_DUMP_CMD_ECHO;

// For debug purposes
typedef struct tag_msp_ENDPOINT_MUX_STOP_DATA_DUMP_CMD
{
	WORD	DataKind;	// Control/Video/Audio
} msp_ENDPOINT_MUX_STOP_DATA_DUMP_CMD;

typedef struct tag_msp_ENDPOINT_MUX_STOP_DATA_DUMP_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
//	WORD	SuccessFlag;
	WORD	DataKind;	// Control/Video/Audio
} msp_ENDPOINT_MUX_STOP_DATA_DUMP_CMD_ECHO;

// Enable/Disable Demux Input Queues
typedef struct tag_msp_ENDPOINT_MUX_DEMUX_OUT_QUEUE_CTRL_CMD
{
	WORD	Enable;	// 1=Enable Demux Input Queues, 0=Disable
} msp_ENDPOINT_MUX_DEMUX_OUT_QUEUE_CTRL_CMD;

typedef struct tag_msp_ENDPOINT_MUX_DEMUX_OUT_QUEUE_CTRL_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
	WORD	Enable;	// 1=Enable Demux Input Queues, 0=Disable
} msp_ENDPOINT_MUX_DEMUX_OUT_QUEUE_CTRL_CMD_ECHO;


/***********************************************************/
/* ENDPOINT_MUX_DEMUX_RESET_STATS_CMD                      */
/* Purpose:                                                */
/* DSP contains counters that are incremented              */
/* after CRC check for a PDU's payload or                  */
/* after the Golay coding check for a PDU's header.        */
/* This command will reset these counters.                 */
/* Host app sends this command to the DSP at the beginning */
/* of each new call.                                       */
/***********************************************************/
typedef struct tag_msp_ENDPOINT_DEMUX_RESET_STATS_CMD
{
    WORD	Mode;  // 0 = reset DSP error counters  
}  msp_ENDPOINT_DEMUX_RESET_STATS_CMD;

typedef struct tag_msp_ENDPOINT_DEMUX_RESET_STATS_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;          //Success Flag in upper byte, CmdId in lower byte
    WORD	Mode;  // 0 = reset DSP error counters  
}  msp_ENDPOINT_MUX_RESET_STATS_CMD_ECHO;

/***********************************************************/
/* ENDPOINT_MUX_DEMUX_GET_PERIODIC_STATS_CMD               */
/* Purpose:                                                */
/* Video/audio/header error information will be reported   */
/* to host after receiving this command.                   */
/* If time = 0, DSP sends 1 event in response.             */
/* If time > 0 such as 10, then DSP sends 1 event every    */
/* 10 seconds.                                             */
/***********************************************************/
typedef struct tag_msp_ENDPOINT_DEMUX_GET_PERIODIC_STATS_CMD 
{
   WORD state; //  1 = stat reporting ON
              //  0 = stat reporting OFF
   WORD time;  //  0 = query stats once
              //  N = report stats every N seconds
}  msp_ENDPOINT_DEMUX_GET_PERIODIC_STATS_CMD;

typedef struct tag_msp_ENDPOINT_DEMUX_GET_PERIODIC_STATS_CMD_ECHO 
{
	DWORD	FilterId;
	WORD	CmdId;          //Success Flag in upper byte, CmdId in lower byte
    WORD state;
    WORD time;  
}  msp_ENDPOINT_DEMUX_GET_PERIODIC_STATS_CMD_ECHO;

/***********************************************************/
/* ENDPOINT_MUX_DEMUX_CRC_ERROR_REPORTS_CMD                */
/* Purpose:                                                */
/* Video/audio/header error information will be reported   */
/* for every bit/byte error detected.                      */
/***********************************************************/
typedef struct tag_msp_ENDPOINT_DEMUX_CRC_ERROR_REPORTS_CMD
{
   WORD state; //  1 = CRC error reporting ON
              //  0 = CRC error reporting OFF
   WORD error_check_type;  // 1 = video CRC check            
                          // 2 = audio CRC check 
                          // 3 = audio + video CRC check
                          // 4 = header Golay coding check
                          // 7 = audio + video + header checks
}  msp_ENDPOINT_DEMUX_CRC_ERROR_REPORTS_CMD;

typedef struct tag_msp_ENDPOINT_DEMUX_CRC_ERROR_REPORTS_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;          //Success Flag in upper byte, CmdId in lower byte
    WORD state; //  1 = CRC error reporting ON
               //  0 = CRC error reporting OFF
    WORD error_check_type; 
}  msp_ENDPOINT_DEMUX_CRC_ERROR_REPORTS_CMD_ECHO;

/*******************************************************************/
/* AMR Channel command structure                                  */
/*******************************************************************/
typedef struct tag_msp_FILTER_AMR_SET_AUDIO_RATE_CMD
{
	WORD	Rate;			// Audio rate to be set
} msp_FILTER_AMR_SET_AUDIO_RATE_CMD;

typedef struct tag_msp_FILTER_AMR_SET_AUDIO_RATE_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
	WORD	Rate;			// Audio rate to be set
} msp_FILTER_AMR_SET_AUDIO_RATE_CMD_ECHO;

typedef struct tag_msp_FILTER_AMR_SET_DTX_CMD
{
	WORD	On;			// 0=Off, 1=On
} msp_FILTER_AMR_SWITCH_DTX_CMD;

typedef struct tag_msp_FILTER_AMR_SET_DTX_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
	WORD	On;			// 0=Off, 1=On
} msp_FILTER_AMR_SET_DTX_CMD_ECHO;

typedef struct tag_msp_FILTER_AMR_SET_PLC_CMD
{
    WORD    mode;           // 1=PLC on, 0=PLC off
	WORD	repeatCount;    // Sample value Range: 1 to 10
} msp_FILTER_AMR_SET_PLC_CMD;

typedef struct tag_msp_FILTER_AMR_SET_PLC_CMD_ECHO
{
	DWORD	FilterId;
	WORD	CmdId;          //Success Flag in upper byte, CmdId in lower byte
    WORD    mode;           // 1=PLC on, 0=PLC off
	WORD	repeatCount;    // Sample value Range: 1 to 10
} msp_FILTER_AMR_SET_PLC_CMD_ECHO;


/*******************************************************************/
/* MUX endpoint MC Table command structures                        */
/*******************************************************************/

/*   These structures are used for sending an MC Table entry       */
/*   to the Demux                                                  */

typedef struct H245MesMultiElm_t 
{
    WORD    LCNType;                  /*  Logical Channel Type - control, audio, or video */ 
                                        /*  Range: 0=Control, 1=Audio, 2=Video              */
    WORD    ulogicalChannelNumber;    /*  Logical ChannelNumber - Range: 0 to 15          */
    WORD    uRepeatCount;             /*  Repeat Count - Range: 0 to 255                  */
    WORD    ALClassification;         /*  Adaptation Layer Class - Range:1 to 3           */
                                        /*  1=AL1, 2=AL2, 3=AL3                             */
                                        /*  Control is AL1, Video may be AL2 or AL3         */
                                        /*  Audio is AL2                                    */
    WORD    CRC_Control;              /*  CRC bits - Range: 0=no CRC, 1=8 bit (one byte), */ 
                                        /*  2=16 bit (two bytes)                            */
    WORD    SNMode;                   /*  Sequence Numbering - Range: 0 to 2              */
                                        /*  0 = no Seq. Numbers, 1 = 1 octet Seq. Number,   */
                                        /*  2 = 2 octet Seq. Number (Video only)            */
    WORD    NoOfFrames;               /*  Number of Audio Frames                          */
                                        /*  Range = 0 to 3.  1 to 3 for Audio.              */
                                        /*  0 for Ctl or Vid                                */
    WORD    state;                    /*  Channel activity state.                         */
                                        /*  Range: 0 to 1.  1=Active, 0=Inactive :          */
                                        /*  If Channel is Inactive, data is dropped         */
    WORD    MaxSduSize;               /*  Maximum SDU size - Range: 0 to 256              */ 
    WORD    Reserved1;                  /*  Reserved word - Not used.                       */
}  H245MesMultiElm;


typedef struct H245MulTblEnt_t 
{
    WORD            MulTblEntryIndex;     /* MC Table Entry Index             */
                                            /* Range: 0 to 9                    */
    WORD            uElmNum;              /* Number of Elements for the Entry */
                                            /* Range: 0 to 15                   */
    WORD            nestingLevel;         /* Nesting level                    */
                                            /* Range: 0 to 2                    */
    WORD            subElementListSize;   /* Sub Element List Size            */
                                            /* Range: 0 to 15                   */
    WORD            Reserved1;              /* Reserved Word - Not used.        */
    H245MesMultiElm pElmList[3];           /* List of H245MesMultiElm          */
}  H245MulTblEnt;


/*   This structures is used for the command to retrieve  */
/*   an MC Table entry                                    */

typedef struct H245RetrieveMulTblEnt_t 
{
    WORD	MulTblEntryIndex;   /* MC Table Entry Index		*/
                                /* Range: 0 to 9			*/
} H245RetrieveMulTblEnt;

/*   This event structure is the returned echo when retrieving    */
/*   an MC Table entry                                            */

typedef struct H245MulTblEntEvent_t
{
	DWORD           FilterId;
	WORD            CmdId;      //Success Flag in upper byte, CmdId in lower byte
	H245MulTblEnt   TblEnt;     //The table entry structure
} H245MulTblEntEvent;

typedef struct tag_msp_ENDPOINT_MUX_NSRP_MODE_CMD
{
	WORD		Mode;			// 0=DSP NSRP Support Off, 1=DSP Support On
} msp_ENDPOINT_MUX_NSRP_MODE_CMD;

typedef struct tag_msp_ENDPOINT_MUX_STUFFING_MODE_CMD
{
	WORD		Mode;			// 0=Send Zeros
								// 1=Send E1 4D 00 00 00
} msp_ENDPOINT_MUX_STUFFING_MODE_CMD;

/*******************************************************************/
/* Special Header command structures                               */
/*******************************************************************/

// These structures are used for adding/removing Special Headers
// at the beginning of RTP payload for video

typedef struct tag_msp_ENDPOINT_VIDMP4_ADD_SPECIAL_HDR
{
	DWORD  size;  // Number of bytes id data array.
                  // Actual Special Header size will be 4 bytes longer
                  // because of the MPEG4 Payload Length and
                  // Original Sequence Number fields in the actual header.

#define MAX_SPECIAL_HDR_SIZE  60
    BYTE   data[MAX_SPECIAL_HDR_SIZE];

} msp_ENDPOINT_VIDMP4_ADD_SPECIAL_HDR;

typedef struct tag_msp_FILTER_JITTER_VIDMP4_REMOVE_SPECIAL_HDR
{
	DWORD  size;  // Size in bytes of Special Header to be removed.
                  // Limited to MAX_SPECIAL_HDR_SIZE + 4.

} msp_FILTER_JITTER_VIDMP4_REMOVE_SPECIAL_HDR;

#ifdef __cplusplus
}
#endif

#endif /* MSPCMD_H */

